# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/27 下午4:45
 @Author  : tgy
 
"""

def my_zip(*args):
    ...
    iters = tuple(iter(arg) for arg in args)
    while iters:
        try:
            # 含有yield的函数return默认会抛StopIterable
            yield tuple(next(it) for it in iters)
        except Exception:
            return
if __name__ == '__main__':
    ...
    names = ['zhangsan','lisi','tony']
    ages = [23,21,24]
    for v in my_zip(names,ages):
        print(v)
    person = dict(my_zip(names, ages))
    print(person)